package com.lx.idea.common.config;

import com.baomidou.mybatisplus.core.handlers.MetaObjectHandler;
import org.apache.ibatis.reflection.MetaObject;
import org.springframework.stereotype.Component;

import java.time.LocalDateTime;

/**
 * @Author ybb
 * @Description
 * @Date 2021/9/2 18:17
 */
@Component
public class DateMateHandler implements MetaObjectHandler{
    @Override
    public void insertFill(MetaObject metaObject) {
        System.out.println("insert.....");
        this.strictInsertFill(metaObject,"createDate", LocalDateTime.class, LocalDateTime.now());
//        this.setFieldValByName("updateTime",new Date(),metaObject);


    }

    @Override
    public void updateFill(MetaObject metaObject) {

    }
}
